import { number } from "echarts";
import { get, post } from "./index";

export interface IShareParm {
    isShare: "1" | "2"; //1 共享，2 个人
    name: string; // 算法名称
    page: number;
    pageSize: number | -1; // -1 是全部
}

interface dtoListItem {
    id: number;
    name: string;
}

export interface IShareList {
    algorithmDtoList?: dtoListItem[];
    modelDtoList?: dtoListItem[];
    dataSetDtoList?: dtoListItem[];
    total: number;
}

// AI空间-算法列表
export const algorithmShareList = async (data: IShareParm): Promise<IShareList> => {
    const res = await post("/algorithm/share/list",  data );
    return res.data;
};

// AI空间-模型列表
export const modelShareList = async (data: IShareParm): Promise<IShareList> => {
    const res = await post("/model/share/list", data );
    return res.data;
};

// AI空间-数据集列表
export const datasetShareList = async (data: IShareParm): Promise<IShareList> => {
    const res = await post("/dataset/share/list",  data );
    return res.data;
};
